package net.lzzy;

import java.util.Comparator;
import net.lzzy.GeometricObject;

public class GeometricObjectComparator
        implements Comparator<GeometricObject>, java.io.Serializable{
    public int compare(GeometricObject o1, GeometricObject o2) {
        double areq1 = o1.getArea();
        double areg2 = o2.getArea();

        if (areq1 < areg2)
            return -1;
        else if (areq1 == areg2)
            return 0;
        else
            return 1;
    }

}
